<div class="keys view">
    <h2 class="left"><?php __('Llave'); ?></h2>
    <div class="actions specific">
        <ul>
            <li><?php echo $this->Html->link(__('Agregar Copia', true), array('action' => 'agregar_copia', $key['Key']['id'])); ?></li>
            <li><?php echo $this->Html->link(__('Editar Llave', true), array('action' => 'edit', $key['Key']['id'])); ?> </li>
            <li><?php echo $this->Html->link(__('Eliminar Llave', true), array('action' => 'delete', $key['Key']['id']), null, sprintf(__('Esta seguro que desea eliminar la llave # %s?', true), $key['Key']['mark'] . ' ' . $key['Key']['model'])); ?> </li>
        </ul>
    </div>
    <br />
    <br />
    <br />
    <dl><?php $i = 0;
$class = ' class="altrow"'; ?>
        <dt<?php if ($i % 2 == 0)
    echo $class; ?>><?php __('Id'); ?></dt>
        <dd<?php if ($i++ % 2 == 0)
                echo $class; ?>>
<?php echo $key['Key']['id']; ?>
            &nbsp;
        </dd>
        <dt<?php if ($i % 2 == 0)
    echo $class; ?>><?php __('Marca'); ?></dt>
        <dd<?php if ($i++ % 2 == 0)
    echo $class; ?>>
            <?php echo $key['Key']['mark']; ?>
            &nbsp;
        </dd>
        <dt<?php if ($i % 2 == 0)
                echo $class; ?>><?php __('Modelo'); ?></dt>
        <dd<?php if ($i++ % 2 == 0)
                echo $class; ?>>
<?php echo $key['Key']['model']; ?>
            &nbsp;
        </dd>
        <dt<?php if ($i % 2 == 0)
    echo $class; ?>><?php __('Chip'); ?></dt>
        <dd<?php if ($i++ % 2 == 0)
    echo $class; ?>>
            <?php echo $key['Key']['chip']; ?>
            &nbsp;
        </dd>
        <dt<?php if ($i % 2 == 0)
                echo $class; ?>><?php __('Codigo'); ?></dt>
        <dd<?php if ($i++ % 2 == 0)
                echo $class; ?>>
<?php echo $key['Key']['code']; ?>
            &nbsp;
        </dd>
        <dt<?php if ($i % 2 == 0)
    echo $class; ?>><?php __('Estilo'); ?></dt>
        <dd<?php if ($i++ % 2 == 0)
    echo $class; ?>>
<?php echo $key['Key']['style']; ?>
            &nbsp;
        </dd>
        <dt<?php if ($i % 2 == 0)
    echo $class; ?>><?php __('Auto'); ?></dt>
        <dd<?php if ($i++ % 2 == 0)
    echo $class; ?>>
        <?php echo $this->Html->link($key['Car']['letter'] . ' ' . $key['Car']['number'], array('controller' => 'cars', 'action' => 'view', $key['Car']['id'])); ?>
            &nbsp;
        </dd>
    </dl>
</div>
<div class="copies index">
    <h2><?php __('Copias'); ?></h2>
    <table cellpadding="0" cellspacing="0">
        <tr>
            <th><?php echo 'N°'; ?></th>
            <th><?php echo 'Fecha'; ?></th>
            <th><?php echo 'Detalle'; ?></th>
            <th><?php echo 'Precio'; ?></th>
<!--			<th><?php echo 'Llave'; ?></th>-->
            <th class="actions"><?php __('Opciones'); ?></th>
        </tr>
<?php
$i = 0;
//        pr($key);die;
foreach ($key['Copy'] as $copy):
    $class = null;
    if ($i++ % 2 == 0) {
        $class = ' class="altrow"';
    }
    ?>
            <tr<?php echo $class; ?>>
                <td><?php echo $i; ?>&nbsp;</td>
                <td><?php
        $fecha = date('d/m/Y', strtotime($copy['date']));
        echo $fecha;
        ?>&nbsp;</td>
                <td><?php echo $copy['detail']; ?>&nbsp;</td>
                <td><?php echo '$'.$copy['price']; ?>&nbsp;</td>
    <!--		<td>
    <?php echo $this->Html->link($copy['Key']['id'], array('controller' => 'keys', 'action' => 'view', $copy['Key']['id'])); ?>
                </td>-->
                <td class="actions">
    <?php echo $this->Html->link(__('Ver', true), array('controller' => 'copies', 'action' => 'view', $copy['id'])); ?>
    <?php echo $this->Html->link(__('Editar', true), array('controller' => 'copies', 'action' => 'edit', $copy['id'])); ?>
    <?php echo $this->Html->link(__('Eliminar', true), array('controller' => 'copies', 'action' => 'delete', $copy['id']), null, sprintf(__('Esta seguro que desea eliminar la copia con fecha # %s?', true), $fecha)); ?>
                </td>
            </tr>
<?php endforeach; ?>
    </table>
</div>
